package org.honeyweb.gsoc.pages;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tapestry5.annotations.*;
import org.apache.tapestry5.ioc.annotations.*;


import org.honeyweb.gsoc.model.Users;
import org.honeyweb.gsoc.services.UsersManager;

/**
 * Start page of application gsoc.
 */
public class Home
{
	
	private final Log logger = LogFactory.getLog(Home.class);

	@Inject
	@Service("usersManager")
	private UsersManager usersManager;
	
	@SessionState(create=false)
	private String userName;
	
	@SessionState
	private Users user;


	public Users getUser() {
		return user;
	}

	public void setUser(Users user) {
		this.user = user;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
    
	public void onActivate() {
		this.user = usersManager.getUser(userName);
	}
	
	

	
}
